package com.work.chat.custom.server.controller;

import com.work.chat.common.util.Response;
import com.work.chat.common.util.StaticProperties;
import com.work.chat.custom.server.mapper.UserMapper;
import com.work.chat.custom.server.pojo.dto.UserLoginInfoDTO;
import com.work.chat.custom.server.server.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping(StaticProperties.USER)
@RestController
@Validated
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping(StaticProperties.USER_LOGIN)
        public Response login(@RequestBody UserLoginInfoDTO userLoginInfoDTO)
    {
        return Response.buildSuccess(userService.loginIn(userLoginInfoDTO));
    }

}
